# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=jsql-injection
pkgver=0.112
pkgrel=1
pkgdesc='A Java application for automatic SQL database injection.'
groups=('blackarch' 'blackarch-webapp' 'blackarch-exploitation'
        'blackarch-fuzzer')
arch=('any')
url='https://github.com/ron190/jsql-injection'
license=('GPL2')
depends=('java-environment')
makedepends=('git')
noextract=("$pkgname-v$pkgver.jar")
source=("https://github.com/ron190/jsql-injection/releases/download/v$pkgver/$pkgname-v$pkgver.jar")
sha512sums=('6d09cee2b592923f318305edcfad1d0fd78aa0dd37cabd344a4072165e505415a40c118aa44371805271ebe6a2245d622f7ae4bbf11252159f97d0d003fe3206')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 "$pkgname-v$pkgver.jar" \
    "$pkgdir/usr/share/$pkgname/$pkgname-v$pkgver.jar"

  cat > "$pkgdir/usr/bin/$pkgname"<< EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/$pkgname-v$pkgver.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

